package com.example.sxmall.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.sxmall.service.*;
import com.example.sxmall.until.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class BaseController {
    @Autowired
    HttpServletRequest req;
    @Autowired
    RedisUtil redisUtil;

    @Autowired
    AdminsService adminsService;
    @Autowired
    PermissionService permissionService;
    @Autowired
    PercontentService percontentService;

    @Autowired
    PermPercService permPercService;
    @Autowired
    AdminsPermisController adminsPermisController;
    @Autowired
    AdminsPermisService adminsPermisService;

    /*获取页码*/
    public Page getPage(){
        int currentPage = ServletRequestUtils.getIntParameter(req,"currentPage",1);
        int size = ServletRequestUtils.getIntParameter(req,"size",10);
        return new Page(currentPage,size);

    }

}
